﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using SnakeShop.Auth.HttpContextUser;

namespace SnakeShop.Auth
{
    /// <summary>
    /// 上下文启动
    /// </summary>
    public static class HttpContextSetup
    {

        public static void AddHttpContextSetup(this IServiceCollection services)
        {
            //看一下？？？
            if(services == null) throw new ArgumentNullException(nameof(services));

            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
            services.AddScoped<IHttpContextUser, AspNetUser>();

        }

    }
}
